package com.fms.controller;

import com.fms.dto.ShipmentsDto;
import com.fms.result.ResultData;
import com.fms.service.ShipmentService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;


@RestController
@CrossOrigin
@RequestMapping("/shipment")
@RequiredArgsConstructor
public class ShipmentController {

    private final ShipmentService shipmentService;

    @GetMapping("/getShipments/{id}")
    public ResultData getShipments(@PathVariable("id") Long id) {
        return shipmentService.getShipments(id);
    }

    @PostMapping("/updateShipments")
    public ResultData updateShipments(@RequestBody ShipmentsDto shipments){
        return shipmentService.updateShipments(shipments);
    }
}
